home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
pascal
/
fastkey.exe
/
C_DEMO.CPP
next >
Wrap
C/C++ Source or Header
|
1992-12-11
|
857b
|
34 lines
#include <stdio.h>
#include <conio.h>
#include "fastkey.h"
/*──────────────────────────────────────────────────────────────────────────*/
/* Purpose: To demonstrate the advantages of FASTKEY over the standard */
/* method of checking the keyboard. */
/*──────────────────────────────────────────────────────────────────────────*/
void main() {
int X=40, Y=20;
char line[80];
clrscr();
printf("FastKey Demonstration - For Borland C++. Press Esc to exit.");
InstallFastKey();
while(!Pressed(FKEsc)) {
gotoxy(X,Y); cputs("X");
if (Pressed(FKLeft) && !Pressed(FKRight)) {
gotoxy(X,Y); cputs(" ");
if (X > 1) X--;
};
if (Pressed(FKRight) && !Pressed(FKLeft)) {
gotoxy(X,Y); cputs(" ");
if (X < 79) X++;
};
};
UnInstallFastKey();
clrscr();
};